<!-- 数据处理模块 -->
<div style="display:none;">
	<div class="c-p-process-module" module="html">
		<section>
			<ul class="nav nav-tabs">
	            <li class="active"><a href="#p_m_html_allow" data-toggle="tab">保留标签</a></li>
	            <li><a href="#p_m_html_filter" data-toggle="tab">过滤标签</a></li>
			</ul>
			<div class="tab-content" style="padding-top:10px;">
                <div class="tab-pane fade in active" id="p_m_html_allow">
					<div class="form-group">
						<input type="text" data-process="html:html_allow" class="form-control" value="p,br,img" />
						<div class="p-m-html-tags" module-html="html_allow">
							<a href="javascript:;"><span>img</span>图片</a>
							<a href="javascript:;"><span>a</span>超链接</a>
							<a href="javascript:;"><span>p</span>段落</a>
							<a href="javascript:;"><span>br</span>换行</a>
						</div>
					</div>
                </div>
                <div class="tab-pane fade" id="p_m_html_filter">
                    <div class="form-group">
						<input type="text" data-process="html:html_filter" class="form-control" value="" />
						<div class="p-m-html-tags" module-html="html_filter">
							<a href="javascript:;"><span>all</span>全部标签</a>
							<a href="javascript:;"><span>a</span>超链接</a>
							<a href="javascript:;"><span>img</span>图片</a>
							<a href="javascript:;"><span>div</span>层</a>
							<a href="javascript:;"><span>p</span>段落</a>
							<a href="javascript:;"><span>br</span>换行</a>
							<a href="javascript:;"><span>form</span>表单</a>
							<a href="javascript:;"><span>iframe</span>框架</a>
							<a href="javascript:;"><span>object</span>对象</a>
							<a href="javascript:;"><span>script</span>脚本</a>
							<a href="javascript:;"><span>style</span>样式</a>
							<a href="javascript:;"><span>link</span>外部样式</a>
						</div>
					</div>
                </div>
            </div>
	   		<p class="help-block">其它标签可直接输入，用空格或逗号分隔</p>
	   	</section>
	</div>
	<div class="c-p-process-module" module="replace">
		<div class="input-group">
			<textarea data-process="replace:replace_from" rows="3" class="form-control"></textarea>
			<div class="input-group-addon iga-rt">
		      	<a href="javascript:;" title="{$Think.lang.tips_sign_wildcard}" class="blk sign-wildcard">{$Think.lang.sign_wildcard}</a>
				<span title="{$Think.lang.tips_regular}" class="blk">正则</span>
			</div>
		</div>
		<p style="margin:5px 0;">替换成</p>
		<div class="form-group">
			<textarea data-process="replace:replace_to" rows="3" class="form-control"></textarea>
			<p class="help-block">可使用<b>$数字</b>调用正则捕获组（不包括通配符）的内容</p>
		</div>
	</div>
	<div class="c-p-process-module" module="filter">
		<div class="form-group">
			<label>一行一个关键词</label>
			<textarea data-process="filter:filter_list" rows="3" class="form-control"></textarea>
		</div>
		<div class="form-group">
			<div class="radio"><label><input type="radio" data-process="filter:filter_pass" value="" /> 关键词替换成</label></div>
			<input type="text" data-process="filter:filter_replace" class="form-control" value="" />
		</div>
		<div class="radio"><label><input type="radio" data-process="filter:filter_pass" value="1" /> 检测到关键词将该字段值设为空</label></div>
		<div class="radio"><label><input type="radio" data-process="filter:filter_pass" value="2" /> 检测到关键词不采集该条数据</label></div>
		<div class="radio"><label><input type="radio" data-process="filter:filter_pass" value="3" /> 未检测到关键词将该字段值设为空</label></div>
		<div class="radio"><label><input type="radio" data-process="filter:filter_pass" value="4" /> 未检测到关键词不采集该条数据</label></div>
	</div>
	<div class="c-p-process-module" module="if">
		<section>
		<div class="form-group">
			<div class="input-group">
				<span class="input-group-addon">条件判断</span>
				<select data-process="if:if_type" class="form-control">
					<option value="1">{$Think.lang.p_m_if_1}</option>
					<option value="2">{$Think.lang.p_m_if_2}</option>
					<option value="3">{$Think.lang.p_m_if_3}</option>
					<option value="4">{$Think.lang.p_m_if_4}</option>
				</select>
				<div class="input-group-btn">
		    		<button class="btn btn-default p-m-if-add" type="button"><span class="glyphicon glyphicon-plus" style="color:#3c8dbc"></span></button>
				</div>
			</div>
		</div>
		<div class="form-group">
    		<div class="table-responsive">
            	<table class="table table-hover p-m-if-table">
                   <thead>
                       <tr>
                           <th style="min-width:95px;">逻辑</th>
                           <th style="min-width:150px;">条件</th>
                           <th style="min-width:200px;">值</th>
                           <th></th>
                       </tr>
                   </thead>
                   <tbody>
                   <tr class="p-m-if-table-tpl" style="display:none;">
                   	<td>
                   		<select data-process="if:if_logic:" class="form-control">
                   			<option value="and">并且</option>
                   			<option value="or">或者</option>
                   		</select>
                   	</td>
                   	<td>
                   		<select data-process="if:if_cond:" class="form-control">
                   			<option value="has">包含</option>
                   			<option value="nhas">不包含</option>
                   			<option value="eq">等于</option>
                   			<option value="neq">不等于</option>
                   			<option value="heq">恒等于</option>
                   			<option value="nheq">不恒等于</option>
                   			<option value="gt">大于</option>
                   			<option value="egt">大于等于</option>
                   			<option value="lt">小于</option>
                   			<option value="elt">小于等于</option>
                   			<option value="time_eq">时间等于</option>
                   			<option value="time_egt">时间大于等于</option>
                   			<option value="time_elt">时间小于等于</option>
                   			<option value="regexp">正则表达式</option>
                   			<option value="func">使用函数</option>
                   		</select>
                   	</td>
                   	<td>
                  		<input type="text" data-process="if:if_val:" class="form-control" />
                  		<div class="input-group-btn p-m-if-time" style="display:none;">
					        <select class="form-control p-m-if-time-val">
                  				<option value="now">当前时间</option>
								<option value="today">今天</option>
								<option value="today +1 day">明天</option>
								<option value="today +2 day">后天</option>
								<option value="today -1 day">昨天</option>
								<option value="today -2 day">前天</option>
								<option value="-1 monday">本周一</option>
								<option value="sunday">本周日</option>
								<option value="today -1 week">上周今天</option>
								<option value="-2 monday">上周一</option>
								<option value="-1 sunday">上周日</option>
								<option value="today +1 week">下周今天</option>
								<option value="+1 monday">下周一</option>
								<option value="+2 sunday">下周日</option>
								<option value="today -1 month">上月今天</option>
								<option value="first day of today -1 month">上月第一天</option>
								<option value="last day of today -1 month">上月最后一天</option>
								<option value="today +1 month">下月今天</option>
								<option value="first day of today +1 month">下月第一天</option>
								<option value="last day of today +1 month">下月最后一天</option>
                  			</select>	
                  		</div>
                  		<div class="input-group p-m-if-func" style="display:none;">
	                   		<select data-process="if:if_addon:func:" class="form-control">
								<option value="">--选择函数--</option>
								<optgroup label="系统函数">
									{foreach $Think.config.allow_process_if as $k=>$v}
									<option value="{$k}">{$k}：{$v}</option>
									{/foreach}
									{if is_array($Think.config.EXTEND_PROCESS_IF)}
									{foreach $Think.config.EXTEND_PROCESS_IF as $k=>$v}
									<option value="{$k}">{$k}：{$v}</option>
									{/foreach}
									{/if}
								</optgroup>
	                   		</select>
                  			<div class="input-group-btn">
                  				<select data-process="if:if_addon:turn:" class="form-control">
                  					<option value="">正常</option>
                  					<option value="1">取反</option>
                  				</select>
                  			</div>
					    	<a href="javascript:;" class="input-group-addon p-m-if-func-info"><span class="glyphicon glyphicon-info-sign"></span></a>
					    	<div class="p-m-if-func-tips" style="display:none;">
					    		先选择函数（取反可获取函数结果的相反值），默认会传入当前字段值
								<br>如需传入多个参数，一行一个值，用###表示当前字段值
					    		<br>如需扩展系统函数，请在根目录/data/config.php中添加配置：'EXTEND_PROCESS_IF'=&gt;array('PHP函数名'=&gt;'描述')
								<br>如需扩展插件函数，可以创建<a href="{:url('Develop/func')}" target="_blank">函数插件</a>
					    	</div>
                  		</div>
                   	</td>
                   	<td>
                   		<a href="javascript:;" class="glyphicon glyphicon-remove p-m-if-del" style="margin-top:8px;"></a>
                   	</td>
                   </tr>
                   </tbody>
				</table>
        	</div>
		</div>
		</section>
	</div>
	<div class="c-p-process-module" module="translate">
		{if empty($transApiLangs)}
		<a href="{:url('Setting/Translate')}" target="_blank">请先开启并配置翻译接口</a>
		{else/}
		<div class="form-group">
			<div class="input-group">
				<select data-process="translate:translate_from" class="form-control">
					<option value="">--源语言--</option>
					{foreach $transApiLangs as $k=>$v}
					<option value="{$k}">{$v}</option>
					{/foreach}
				</select>
				<span class="input-group-addon" style="border-left:0;border-right:0;">翻译为</span>
				<select data-process="translate:translate_to" class="form-control">
					<option value="">--目标语言--</option>
					{foreach $transApiLangs as $k=>$v}
					<option value="{$k}">{$v}</option>
					{/foreach}
				</select>
			</div>
			<p class="help-block">不支持自动识别，请设置源语言和目标语言</p>
		</div>
		{/if}
	</div>
	<div class="c-p-process-module" module="tool">
		<div class="checkbox">
			<label><input type="checkbox" data-process="tool:tool_list" value="trim" />去除前后空格</label>
			&nbsp; <label><input type="checkbox" data-process="tool:tool_list" value="format" />清除文本格式（去除html元素所有样式，如：id、class、style等）</label>
			&nbsp; <label title="如果字段的值是完整的url链接，标记为图片链接后可将其图片本地化"><input type="checkbox" data-process="tool:tool_list" value="is_img" />将文本链接标记为图片链接</label>
		</div>
	</div>
	<div class="c-p-process-module" module="batch">
		<div class="form-group">
			<label>批量替换</label>
			<textarea data-process="batch:batch_list" rows="3" class="form-control"></textarea>
			<p class="help-block">一行一对替换词，用“=”分隔，例如：aa=bb，即将“aa”替换成“bb”</p>
		</div>
	</div>
	<div class="c-p-process-module" module="substr">
		<div class="form-group">
			<label>截取长度</label>
			<input type="number" data-process="substr:substr_len" class="form-control" />
		</div>
		<div class="form-group">
			<label>结尾字符</label>
			<input type="text" data-process="substr:substr_end" class="form-control" />
		</div>
	</div>
	<div class="c-p-process-module" module="func">
		<section>
		<div class="form-group">
			<label>PHP函数名</label>
			<select data-process="func:func_name"  class="form-control">
				<option value="">--请选择--</option>
				<optgroup label="系统函数">
					{foreach $Think.config.allow_process_func as $k=>$v}
					<option value="{$k}">{$k}：{$v}</option>
					{/foreach}
					{if is_array($Think.config.EXTEND_PROCESS_FUNC)}
					{foreach $Think.config.EXTEND_PROCESS_FUNC as $k=>$v}
					<option value="{$k}">{$k}：{$v}</option>
					{/foreach}
					{/if}
				</optgroup>
			</select>
		</div>
		<div class="form-group">
			<label>传入参数</label>
			<textarea data-process="func:func_param" rows="2" class="form-control" placeholder="默认传入当前字段的值"></textarea>
			<div class="help-block">
				一行一个值，可输入任何内容或
				<div class="dropdown p-m-func-fields" style="display:inline;">
					<a class="dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
						调用字段值
						<span class="caret"></span>
					</a>
					<ul class="dropdown-menu">
						<li><a href="javascript:;" data-val="###">###表示当前字段</a></li>
					</ul>
				</div>
				，请按函数传参，否则运行出错！<a href="javascript:;" onclick="$(this).siblings('span').show();">扩展函数</a>
				<span style="display:none;">
					<br>如需扩展系统函数，请在根目录/data/config.php中添加配置：
					'EXTEND_PROCESS_FUNC'=&gt;array('PHP函数名'=&gt;'描述')
					<br>如需扩展插件函数，可以创建<a href="{:url('Develop/func')}" target="_blank">函数插件</a>
				</span>
			</div>
		</div>
		</section>
	</div>
	<div class="c-p-process-module" module="api">
		<section>
		<div class="form-group">
			<label>接口地址</label>
			<input type="text" data-process="api:api_url" class="form-control" />
			<p class="help-block">以/开头自动补全为{:config('root_website')}/</p>
		</div>
		<div class="form-group">
			<label>请求方式</label>
			<select data-process="api:api_type" class="form-control">
				<option value="">GET</option>
				<option value="post">POST</option>
			</select>
		</div>
		<div class="form-group">
	     	<label>请求参数</label>
	      	<a href="javascript:;" class="glyphicon glyphicon-plus p-m-api-add" title="添加"></a>
	   		<div class="table-responsive">
	           	<table class="table table-bordered table-hover p-m-api-table" style="margin-bottom:0;">
		            <thead>
	                <tr>
	                    <th>名称</th>
	                    <th>值</th>
	                    <th style="width:50px;">删除</th>
	                </tr>
		            </thead>
		            <tbody>
					<tr class="p-m-api-table-tpl" style="display:none;">
						<td>
							<input type="text" data-process="api:api_params:name:" class="form-control">
						</td>
						<td>
							<div class="input-group">
								<div class="input-group-btn">
									<select data-process="api:api_params:val:" class="form-control" style="min-width:110px;">
										<option value="">空</option>
										<option value="field">当前字段的值</option>
										<option value="timestamp">当前时间戳</option>
										<option value="time">当前日期</option>
										<option value="custom">自定义</option>
									</select>
								</div>
								<input type="text" data-process="api:api_params:addon:" class="form-control" style="display:none;margin-left:-1px;">
							</div>
						</td>
						<td>
							<a href="javascript:;" class="glyphicon glyphicon-remove p-m-api-del" style="margin-top:8px;"></a>
						</td>
					</tr>
					</tbody>
				</table>
	       	</div>
		</div>
		<div class="form-group">
	     	<label>提取结果</label>
			<input type="text" data-process="api:api_json" class="form-control" />
			<p class="help-block">json规则： a.b.c 通配符 *</p>
	     </div>
	     <div class="form-group">
			<label>结果是数组则转换为</label>
			<select data-process="api:api_json_arr" class="form-control">
				<option value="implode">字符串</option>
				<option value="jsonencode">json编码</option>
				<option value="serialize">序列化</option>
			</select>
			<textarea data-process="api:api_json_implode" class="form-control" rows="1" placeholder="输入分隔符" style="margin-top:5px;"></textarea>
		</div>
		</section>
	</div>
</div>